package com.zcp.basetemplatedemo;

import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends BaseActivity {

    private TextView tv_age;
    private TextView tv_name;

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    public void initViews() {
        tv_age = findView(R.id.tv_age);
        tv_name = findView(R.id.tv_name);
    }

    @Override
    public void initListener() {
        setOnClick(tv_age);
        setOnClick(tv_name);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_age:
                Toast.makeText(MainActivity.this, "年龄", Toast.LENGTH_SHORT).show();
                break;
            case R.id.tv_name:
                Toast.makeText(MainActivity.this, "姓名", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
